import request from '@/utils/request'

// 查询合作商列表
export function listAgent(query) {
  return request({
    url: '/agent/agent/list',
    method: 'get',
    params: query
  })
}

// 查询合作商详细
export function getAgent(id) {
  return request({
    url: '/agent/agent/' + id,
    method: 'get'
  })
}

// 新增合作商
export function addAgent(data) {
  return request({
    url: '/agent/agent',
    method: 'post',
    data: data
  })
}

// 修改合作商
export function updateAgent(data) {
  return request({
    url: '/agent/agent',
    method: 'put',
    data: data
  })
}

// 删除合作商
export function delAgent(id) {
  return request({
    url: '/agent/agent/' + id,
    method: 'delete'
  })
}

// 导出合作商
export function exportAgent(query) {
  return request({
    url: '/agent/agent/export',
    method: 'get',
    params: query
  })
}

// 用户头像上传
export function uploadAvatar(data) {
  return request({
    url: '/driver/driver/avatar',
    method: 'post',
    data: data
  })
}
